import request from '@/utils/request'

// 获取学校列表
export function getSchools(params) {
  return request({
    url: '/schools/list',
    method: 'get',
    params
  })
}

// 获取学校详情
export function getSchool(id) {
  return request({
    url: `/schools/${id}`,
    method: 'get'
  })
}

// 创建学校
export function createSchool(data) {
  return request({
    url: '/schools',
    method: 'post',
    data
  })
}

// 更新学校
export function updateSchool(data) {
  return request({
    url: `/schools/${data.id}`,
    method: 'put',
    data
  })
}

// 删除学校
export function deleteSchool(id) {
  return request({
    url: `/schools/${id}`,
    method: 'delete'
  })
}

// 更新学校状态
export function updateSchoolStatus(id, status) {
  return request({
    url: `/schools/${id}/status`,
    method: 'put',
    data: { status }
  })
}
